﻿using System;
using SalamanderWnmp.Tool;
using System.Threading;

namespace SalamanderWnmp.Programs
{
    class PHPProgram : BaseProgram
    {

        private const string PHP_CGI_NAME = "php-cgi";
        private const string PHP_MAX_REQUEST = "PHP_FCGI_MAX_REQUESTS";
        private Object locker = new Object();
        private uint FCGI_NUM = 0;
        private bool watchPHPFCGI = true;
        private Thread watchThread;

        public override void Setup()
        {
            string phpDirPath = Common.APP_STARTUP_PATH + Common.Settings.PHPDirName.Value;

            this.exeFile = string.Format("{0}/php-cgi.exe", phpDirPath);
            this.procName = PHP_CGI_NAME;
            this.programName = "PHP";
            this.workingDir = phpDirPath;
            this.progLogSection = Log.LogSection.WNMP_PHP;
            this.startArgs = String.Format("-b 127.0.0.1:{0} -c {1}/php.ini", Common.Settings.PHP_Port.Value, phpDirPath);
            this.killStop = true;
            this.confDir = "/php/";
            this.logDir = "/php/logs/";
        }
    }
}
